<style>
#duzniciMain form{
	width:350px;
}
#duzniciMain label{
	width:70px;
}
#duzniciMain input[type=text]:disabled{
	/*background:#fff;
	border:1px solid #;*/
}
#duzniciMain #odgovor_dana{
	display:none;
}
#duzniciMain textarea{
	width:260px;
	height:120px;
}
#duzniciMain fieldset textarea{
	width:240px;
	height:50px;
}
#duzniciMain input[type=submit]{
	clear:both;
	float:right;
	background-image:url(gui/icons/save.gif);
	background-repeat:no-repeat;
	background-position: 2px center;
	padding-left:18px;
}
#duzniciMain #duznici_history{
	min-width:150px;
	min-height:180px;
	margin:0px 0px 1px 1px;
}
#duzniciMain #duznici_history h3{
	background:url(gui/icons/history.gif) no-repeat 0px center;
	padding:2px 0px 0px 18px;
}
#duzniciMain #komitent_details{
	max-width:400px;
	min-width:150px;
	clear:both;
	margin-left:1px;
}
#duzniciMain #komitent_details a.more_address{
	float:right;
}
#duzniciMain #komitent_details ol{
	float:left;
}
#duzniciMain #kontakt_tel{
	display:block;
	float:left;
	font-size:11px;
	margin-top:8px;
}
#duzniciMain #drugikontakt{
	clear:both;
	display:block;
	float:left;
	margin:0px 5px 5px 75px;
	padding:5px;
}
#duzniciMain #drugikontakt label{
	width:40px;
}
#duzniciCallHistoryList{
	width:420px;
	height:210px;
	display:none;
	overflow:auto;
}
#duzniciCallHistoryList ol{
	width:410px;
	list-style-type:none;
	margin:0px;
	padding:0px;
	border:1px solid #848263;
	background:#fff;
}
#duzniciCallHistoryList ol li{
	list-style-type:none;
	width:400px;
	display:block;
	margin:0px 0px 0px 1px;
	padding:2px 4px;
	border:none;
	border-bottom:1px dotted #aaa;
}
#duzniciCallHistoryList ol li:last-child{
	border-bottom:none;
}
#duznici_alarms ol li i,
#duzniciCallHistoryList ol li i{font-family:Georgia, "Times New Roman", Times, serif;}
#duznici_alarms ol li i:before,
#duzniciCallHistoryList ol li i:before{content:open-quote}
#duznici_alarms li i:after,
#duzniciCallHistoryList ol li i:after{content:close-quote}
#duzniciCallHistoryList ol li .history_date{
	display:block;
	float:right;
}
#duzniciCallHistoryList ol li .history_options{
	float:right;
}
#duzniciCallHistoryList ol li .history_desc{
	font-size:11px;
	margin:5px 0px 0px 15px;
}
#duznici_alarms{
	float:right;
	padding:5px;
	text-align:right;
	overflow:auto;
	max-width:350px;
	display:none;
}
#duznici_alarms #alarm_link{
	display:block;
	float:right;
	height:24px;
	text-decoration:none;
	font-weight:bolder;
	background:url(gui/icons/alarm.gif) no-repeat left center;
	border:none;
	cursor:pointer;
	padding-left:24px;
	font-size:14px;
}
#duznici_alarms ol{
	float:right;
	clear:both;
	text-align:left;
	margin:0px;
	padding:5px 5px 5px 30px;
	display:none;
	max-height:500px;
	overflow:auto;
}
#duznici_alarms ol li{
	margin:0px;
	padding:0px;
	border-bottom:1px dotted #ccc;
	padding:5px;
	cursor:default;
}
#duznici_alarms ol li:hover{
	background:#fff;
}
#duznici_alarms ol li:last-child{
	border-bottom:none;
}
#duznici_alarms ol li.called{
	-moz-opacity:0.2;
	text-decoration:line-through;
}
</style>
<div id="duznici_alarms">
	<input type="button" onclick="duzniciAlarms(this)" id="alarm_link" value="" />
	<ol class="area"></ol>
	<!--<a href="javascript:void(0)" id="alarm_link" onclick="alarmOnclick(this)">&nbsp;</a>-->
</div>
<div id="duzniciMain">
	<form class="area" action="javascript:void(0)" onsubmit="submitForm(this,'duznici.php','POST','afterAddDuznici',true)">
		<input type="hidden" name="a" value="add" />
		<h1>Dužnici</h1>
		<input type="hidden" name="ugovor_id" id="ugovor_id"  value=""/>
		<label class="left" for="ugovor">ugovor:</label class="left">
		<input type="text" name="ugovor" id="ugovor" disabled="disabled"  value=""/>
		<input type="button" onclick="selectUgovor('ugovor','komitent_id','komitent','ugovor_id')" title="Nađi ugovor..." value="" class="ugovorBtn" />
		
		<br clear="all" />
		<label class="left" for="komitent">komitent:</label class="left">
		<input type="text" name="komitent" id="komitent" disabled="disabled" />
		<input type="hidden" name="komitent_id" id="komitent_id" />
		<input type="button" onclick="selectKomitent('komitent','komitent_id','duzniciUpdateKomitentDetails()');" title="Nađi komitenta..." value="" class="searchBtn" />
		
		<br clear="all" />
		<label for="kontakt" class="left">kontakt:</label>
		<select name="kontakt" id="kontakt" onchange="duzniciOnchangeKontakt(this)">
			<option value="-1">---</option>
		</select>
		<span id="kontakt_tel"></span>
		<fieldset id="drugikontakt">
		  <legend>novi</legend>
			<label for="kontakt_drugi" class="left">ime:</label><input type="text" name="kontakt_drugi" id="kontakt_drugi" /><br clear="all" />
			<label class="left" for="kontakt_tel_drugi">tel:</label><input type="text" name="kontakt_tel_drugi" id="kontakt_tel_drugi" />
		</fieldset>
		
		<br clear="all" />
		<label class="left" for="testbox">Odgovor:</label>
		<input type="text" name="odgovor_name" id="odgovor_name" onkeydown="var qs=document.getElementById('YPQSodgovor_name'); if(qs){qs.parentNode.removeChild(qs)};" onblur="this.value = this.getAttribute('defaultValue')" onkeyup="QuickSearch('duznici.php?a=calls&mod=searchOdgovor',this,'odgovor_name')" />
		<input type="text" name="odgovor_dana" id="odgovor_dana" maxlength="2" style="width:20px;" />
		<input type="hidden" name="odgovor" id="odgovor" disabled="disabled" />
		
		<br clear="all" />
		<label class="left" for="obuplata">obećano:</label>
		<input type="text" name="obuplata" id="obuplata" />
		
		<br clear="all" />
		<label for="napomena" class="left">napomena:</label>
		<textarea name="napomena" id="napomena"></textarea>
		
		<br clear="all" />
		<fieldset>
		  <legend>Zaključak:</legend>
			<label class="left" for="ishod">Ishod:</label>
			<select name="ishod" id="ishod">
				{{%loop start ishod_id}}
				<option value="{{$ishod_id}}">{{$ishod_name}}</option>
				{{%loop end}}
			</select><br clear="all" />
			<label class="left" for="result_date">Datum:</label>
			<input type="text" name="result_date" id="result_date" maxlength="10" style="width:60px;" />
			<input type="button" class="datePicker" onclick="displayDatePicker('result_date',this)" title="Odaberi datum" />
			
			<label class="left" for="result_hour" style="width:25px;">Sat:</label>
			<input type="text" maxlength="2" name="result_hour" id="result_hour" style="width:16px;" maxval="23" minval="0" value="0" onchange="fixNumStepVal(this);" />
			<img src="gui/numstep.gif" border="0" usemap="#Map1" class="numstep" />
			<label class="left" for="result_minute" style="width:auto;">Min:</label>
			<input type="text" maxlength="2" name="result_minute" id="result_minute" style="width:16px;" maxval="59" minval="0" value="0" onchange="fixNumStepVal(this)" />
			<img src="gui/numstep.gif" border="0" usemap="#Map2" class="numstep" />
			<map name="Map1" id="Map1">
				<area shape="rect" coords="0,0,7,5" href="javascript:void(0)" onclick="incrementNumStep('result_hour')" />
				<area shape="rect" coords="0,5,7,10" href="javascript:void(0)" onclick="decrementNumStep('result_hour')" />
			</map>
			<map name="Map2" id="Map2">
				<area shape="rect" coords="0,0,7,5" href="javascript:void(0)" onclick="incrementNumStep('result_minute')" />
				<area shape="rect" coords="0,5,7,10" href="javascript:void(0)" onclick="decrementNumStep('result_minute')" />
			</map><br clear="all" />
			<label class="left" for="result_desc">Opis:</label>
			<textarea name="result_desc" id="result_desc"></textarea>
		</fieldset>
		
		<input type="submit" value="sačuvaj" />
	</form>
	<div style="float:left">
		<div id="duznici_history" class="area">
			<h3>Istorija poziva</h3>
			<div id="duzniciCallHistoryList"></div>
		</div>
		<div id="komitent_details" class="area">
			<h3>Detalji komitenta</h3>
		</div>
	</div>
	<br clear="all"/>
	<div id="duznici_za_pozivanje" class="area">
		<h3>Za pozivanje</h3>
		{{$za_pozivanje}}
	</div>
</div>
<script>
duzniciAlarms(document.getElementById("alarm_link"));
</script>